//
//  FFTransferModule.m
//  LiMaoTransfer
//
//  Created by JayLuo on 2020/9/1.
//

#import "FFTransferModule.h"
#import "FFTransferVC.h"
#import "FFTransferCell.h"
#import "FFTransferContent.h"
#import "FFPanelTransferFuncItem.h"
@WKModule(FFTransferModule)

@implementation FFTransferModule

+ (NSString *)gmoduleId {
    return @"LiMaoTransfer";
}

- (NSString *)moduleId {
    return [FFTransferModule gmoduleId];
}


- (void)moduleInit:(WKModuleContext *)context {
    NSLog(@"【LiMaoTransfer】模块初始化！");
    // 注册消息
    [[WKApp shared] registerCellClass:FFTransferCell.class forMessageContntClass:FFTransferContent.class];
    
    // 转账
    [[WKApp shared] setMethod:@"panel.func.item.transfter" handler:^id _Nullable(id  _Nonnull param) {
        FFPanelTransferFuncItem *item = [[FFPanelTransferFuncItem alloc] init];
        item.sort = 9000;
        return item;
    } category:WKPOINT_CATEGORY_PANELFUNCITEM];
    
//    // 更多面板 -> 转账
//    __weak typeof(self) weakSelf = self;
//    [[WKApp shared] setMethod:@"panel.func.item.transfter" handler:^id _Nullable(id  _Nonnull param) {
//        id<WKConversationContext> context = param[@"context"];
//        if(context.channel.channelType == WK_PERSON) {
//            return [WKMoreItemModel initWithImage:[weakSelf imageName:@"more_transfer"] title:LLang(@"转账") onClick:^(id<WKConversationContext>  context) {
//                // 跳转
//                FFTransferVC *vc = [[FFTransferVC alloc] init];
//                vc.uid = [context channel].channelId;
//                [[WKNavigationManager shared] pushViewController:vc animated:YES];
//            }];
//        }
//        return nil;
//    } category:WKPOINT_CATEGORY_PANELMORE_ITEMS sort:2];
    
//    [[FFApp shared] ff_setMethod:@"transfer2" handler:^id _Nullable(id  _Nonnull param) {
//        return [FFMoreItemModel initWithImage:[weakSelf imageName:@"more_transfer"] title:@"转账待收款" onClick:^(id<FFConversationContext>  context) {
//            FFTransferDetailVC *vc = [[FFTransferDetailVC alloc] init];
//            vc.type = LIMTransferDetailUnConfirm;
//            [[FFNavigationManager shared] pushViewController:vc animated:YES];
//        }];
//    } category:FFPOINT_CATEGORY_PANELMORE_ITEMS sort:1];
    
//    [[FFApp shared] ff_setMethod:@"transfer3" handler:^id _Nullable(id  _Nonnull param) {
//        return [FFMoreItemModel initWithImage:[weakSelf imageName:@"more_transfer"] title:@"转账已收款" onClick:^(id<FFConversationContext>  context) {
//            FFTransferDetailVC *vc = [[FFTransferDetailVC alloc] init];
//            vc.type = LIMTransferDetailConfirm;
//            [[FFNavigationManager shared] pushViewController:vc animated:YES];
//        }];
//    } category:FFPOINT_CATEGORY_PANELMORE_ITEMS sort:-1];
    
}



- (UIImage*) imageName:(NSString*)name {
    return [[WKApp shared] loadImage:name moduleID:[FFTransferModule gmoduleId]];
}
@end
